-----------------------------------------------------------------------
-- File:        Crossing.ads
-- Description: Provides crossing acquiring and release functionality
--
-- Requires:    Io_Ports,Unsigned_Types,Raildefs,Dio192defs, Dda06defs,
--              Int32defs
--				
-- Author:     Ha Le
-----------------------------------------------------------------------

with Io_Ports;
with Unsigned_Types;
use Unsigned_Types;  -- 1.8
with Raildefs,
   Dio192defs, Dda06defs, Int32defs;

package Crossing is --PROTECTED

   -- Acquare a Crossing
   --It returns Success=true if the train has acquired the crossing
   --It returns Success=false if another train owns the crossing
   procedure Acquire_Crossing (
         Success :    out Boolean;
         Train   : in     Raildefs. Train_Id;
      B       : in     Raildefs. Crossing_Idx);

   --Release a Crossing
   --It returns Success=true if the train has releaed the crossing
   procedure Release_Crossing (
         Train : in     Raildefs. Train_Id;
         B     : in     Raildefs. Crossing_Idx);

end Crossing;